package Test;

import java.util.Scanner;

public class test3 {
    public static void main(String[] args) {
        //给出一串数
        Scanner sc=new Scanner(System.in);
        System.out.println("输入一个数：");
        int num=sc.nextInt();

        //求数的位数
        int temp=num;
        int count=0;
        while (temp!=0){
            temp=temp/10;
            count++;
        }
        //创建一个数组
        int[] arr=new int[count];
        //把数存给数组
        int Index=arr.length-1;
        temp=num;
        while (temp!=0){
            int ge=temp%10;
            arr[Index]=ge;
            temp=temp/10;
            Index--;
        }

        //每位加五
        for (int i = 0; i < arr.length; i++) {
            arr[i]+=5;
        }
        //对10求余
        for (int i = 0; i < arr.length; i++) {
            arr[i]%=10;
        }
        //进行反转
        for (int i = 0,j=arr.length-1; i < j; i++,j--) {
            int tmp=arr[i];
            arr[i]=arr[j];
            arr[j]=tmp;
        }

        //得到新数
        int number=0;
        for (int i = 0; i < arr.length; i++) {
            number=number*10+arr[i];
        }

        //输出
        System.out.println(number);
    }
}
